<?php
define('UNINCLUDELIMIT',true);
$outvar = array();
include_once('include/include.php');
$outvar[csslist][] = $outvar[css_url].'register.css';
$outvar[jslist][] = DEFAULT_JS_URL.'add_site.js';

if (empty($_SESSION[userName])){
	header("location:register.php");
	exit;
}else {
	switch ($_SESSION[registerstep]){
		case 2 : 
			break;
		default:
			header("location:register_step3.php");
			break;
	}
}
if ($_POST){
	c_create::createClass('site');
	$site = new site();
	$_POST[userId] = $_SESSION[userId];
	if ($site->addRecord($_POST)){
		$_SESSION[registerstep] = 3;
		$_SESSION[showtip] = '网站添加成功！';
		header('location:register_step3.php');
		exit;
	}else {
		$_SESSION[showtip] = $site->action.'失败';
	}
	$outvar = addArray($outvar,$_POST);
	$outvar = addArray($outvar,$site->error);
}
c_create::createClass('catagory');
$cata = new catagory();
$outvar[webtype_max] = $cata->getRecordParent(false);
$outvar[webtype_min] = $cata->getRecordChild(false);

outFile('member/register_step2');
?>